import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', name: 'login', component: () => import('@/views/login') },
  {
    path: '/home', name: 'home', redirect: '/board', component: () => import('@/views/home'), children: [
      { path: '/board', name: 'board', component: () => import('@/views/board') },
      { path: '/board/statistics', name: 'statistics', component: () => import('@/views/board/statistics') },
      { path: '/buy', name: 'buy', component: () => import('@/views/buy') },
      { path: '/hot', name: 'hot', component: () => import('@/views/hot') },
      { path: '/online', name: 'online', component: () => import('@/views/online') },
      { path: '/online/detail', name: 'onlinedetail', component: () => import('@/views/online/detail') },
      { path: '/newuser', name: 'newuser', component: () => import('@/views/newuser') },
      { path: '/lively', name: 'lively', component: () => import('@/views/lively') },
      { path:'/hot/course/:id', name:'course', component:()=> import('@/views/course')  }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
